package seis635.ui;

import seis635.design.*;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.text.DateFormat;

public class AlarmUI{
	
//	private DateFormat timerFormat = MainUI.getTimerFormat();
	private Alarm alr;
	private JPanel alrPanel;
	private JPanel alrNorthPanel;
	private JPanel alrCenterPanel;
	private JPanel alrSouthPanel;
	private JList alrList;
	private JProgressBar progressBar;
	private JButton alrCreateBtn;
	private AlarmCreateUI alarmCreateFrame;

	public JPanel getAlrPanel(){
		return alrPanel;
	}
	public AlarmUI(){
		
		alr = new Alarm(this);

		alrPanel = new JPanel();
		alrPanel.setLayout(new BorderLayout(0, 0));
		
		alrNorthPanel = new JPanel();
		alrPanel.add(alrNorthPanel, BorderLayout.NORTH);
		alrNorthPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
		
		alrCreateBtn = new JButton("Create Alarm");
		alrCreateBtn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				alarmCreateFrame = new AlarmCreateUI();
			}
		});
		alrNorthPanel.add(alrCreateBtn);
		
		alrCenterPanel = new JPanel();
		alrPanel.add(alrCenterPanel, BorderLayout.CENTER);
		
		alrList = new JList();
		alrList.setModel(new AbstractListModel() {
			String[] values = new String[] {"Test1", "Test2", "Test3", "Test4"};
			public int getSize() {
				return values.length;
			}
			public Object getElementAt(int index) {
				return values[index];
			}
		});
		alrCenterPanel.add(alrList);
		
		alrSouthPanel = new JPanel();
		alrPanel.add(alrSouthPanel, BorderLayout.SOUTH);
		
		progressBar = new JProgressBar();
		alrSouthPanel.add(progressBar);
	}

}